package com.ds.dsfans.liteflow.service.impl;

import java.util.List;
import com.ds.dsfans.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ds.dsfans.liteflow.mapper.LiteflowChainMapper;
import com.ds.dsfans.liteflow.domain.LiteflowChain;
import com.ds.dsfans.liteflow.service.ILiteflowChainService;
import com.ds.dsfans.common.core.text.Convert;

/**
 * 规则引擎chainService业务层处理
 * 
 * @author dsfans
 * @date 2024-07-11
 */
@Service
public class LiteflowChainServiceImpl implements ILiteflowChainService 
{
    @Autowired
    private LiteflowChainMapper liteflowChainMapper;

    /**
     * 查询规则引擎chain
     * 
     * @param id 规则引擎chain主键
     * @return 规则引擎chain
     */
    @Override
    public LiteflowChain selectLiteflowChainById(Long id)
    {
        return liteflowChainMapper.selectLiteflowChainById(id);
    }

    /**
     * 查询规则引擎chain列表
     * 
     * @param liteflowChain 规则引擎chain
     * @return 规则引擎chain
     */
    @Override
    public List<LiteflowChain> selectLiteflowChainList(LiteflowChain liteflowChain)
    {
        return liteflowChainMapper.selectLiteflowChainList(liteflowChain);
    }

    /**
     * 新增规则引擎chain
     * 
     * @param liteflowChain 规则引擎chain
     * @return 结果
     */
    @Override
    public int insertLiteflowChain(LiteflowChain liteflowChain)
    {
        liteflowChain.setCreateTime(DateUtils.getNowDate());
        return liteflowChainMapper.insertLiteflowChain(liteflowChain);
    }

    /**
     * 修改规则引擎chain
     * 
     * @param liteflowChain 规则引擎chain
     * @return 结果
     */
    @Override
    public int updateLiteflowChain(LiteflowChain liteflowChain)
    {
        return liteflowChainMapper.updateLiteflowChain(liteflowChain);
    }

    /**
     * 批量删除规则引擎chain
     * 
     * @param ids 需要删除的规则引擎chain主键
     * @return 结果
     */
    @Override
    public int deleteLiteflowChainByIds(String ids)
    {
        return liteflowChainMapper.deleteLiteflowChainByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除规则引擎chain信息
     * 
     * @param id 规则引擎chain主键
     * @return 结果
     */
    @Override
    public int deleteLiteflowChainById(Long id)
    {
        return liteflowChainMapper.deleteLiteflowChainById(id);
    }
}
